home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / wsc4c21.zip / ACCEPT.C < prev    next >
C/C++ Source or Header  |  1997-05-22  |  1KB  |  46 lines

  1. /* accept.c */
  2.  
  3. #include <windows.h>
  4. #include "accept.h"
  5.  
  6. #define TEXT_SIZE 50
  7.  
  8. static char TextEditBuf[TEXT_SIZE] = {"\0"};
  9.  
  10. int GetAcceptText(LPSTR Ptr)
  11. {if(TextEditBuf[0]=='\0') return FALSE;
  12.  else
  13.    {lstrcpy((LPSTR)Ptr,(LPSTR)TextEditBuf);
  14.     TextEditBuf[0] = '\0';
  15.     return TRUE;
  16.    }
  17. }
  18.  
  19. #ifdef WIN32
  20. BOOL CALLBACK
  21. #else
  22. BOOL FAR PASCAL
  23. #endif
  24. AcceptDlgProc(HWND hDlg, UINT iMsg, WPARAM wParam, LPARAM lParam)
  25. {switch (iMsg)
  26.     {case WM_INITDIALOG:
  27.          if(lParam==0) SetWindowText(hDlg,"Enter Phone #");
  28.          if(lParam==1) SetWindowText(hDlg,"XMODEM file name ?");
  29.          if(lParam==2) SetWindowText(hDlg,"YMODEM file name ?");
  30.          return TRUE;
  31.      case WM_COMMAND:
  32.          switch (LOWORD(wParam))
  33.            {case IDD_EDIT:
  34.               GetDlgItemText(hDlg,IDD_EDIT,(LPSTR)TextEditBuf,TEXT_SIZE);
  35.               return TRUE;
  36.             case IDOK:
  37.               EndDialog(hDlg, TRUE);
  38.               return TRUE;
  39.            }
  40.          break;
  41.      default:
  42.          return FALSE;
  43.     }
  44.     return FALSE;
  45. } /* end AcceptDlgProc */
  46.